
package com.jf.cloud.biz.linstener;

import com.jf.cloud.biz.service.SendMessageService;
import com.jf.cloud.biz.service.impl.SendMessageServiceImpl;
import com.jf.cloud.common.order.vo.SendNotifyBO;
import com.jf.cloud.common.rocketmq.config.RocketMqConstant;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zz
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.SEND_NOTIFY_TO_SHOP_TOPIC,consumerGroup = RocketMqConstant.SEND_NOTIFY_TO_SHOP_TOPIC)
public class SendNotifyToShopConsumer implements RocketMQListener<SendNotifyBO> {
    private static final Logger logger = LoggerFactory.getLogger(SendNotifyToShopConsumer.class);

    @Autowired
    private SendMessageService sendMessageService;

    /**
     * 发送店铺消息（订单确认收货、买家发起退款、买家已退货）
     */
    @Override
    public void onMessage(SendNotifyBO sendNotifyBO) {
        logger.info("发送店铺消息（订单确认收货、买家发起退款、买家已退货）>>>>>>>>");
        sendMessageService.sendOrderNotifyMsgToShop(sendNotifyBO);
    }
}
